package com.xiangban.feign.fallback;

import com.xiangban.feign.CommonPayFeign;
import com.xiangban.model.res.ApiResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * @Author ly
 * @date 2021/12/10 15:52
 */
@Component
@Slf4j
public class CommonPayFallback implements FallbackFactory<CommonPayFeign> {
    @Override
    public CommonPayFeign create(Throwable cause) {
           return new CommonPayFeign() {
               @Override
               public ApiResult<Object> unifiedOrder(HashMap<String, String> map) {

                   return ApiResult.newError("unifiedOrder>>>>接口异常");
               }

               @Override
               public ApiResult<Object> transfers(HashMap<String, String> map) {

                   return ApiResult.newError("transfers---->>>>>>接口异常");
               }
           };

    }
}
